﻿using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace _3D.Data
{
    internal class Data
    {
        public static void WriteFile(cMaze maze, int msx, int msy, int seed, int smooth, string name, int x, int y)
        {
            StreamWriter sw;

            using (sw = new StreamWriter(@"mazesave_"+name+".sav", false, Encoding.UTF8))
            {
                sw.WriteLine(msx);
                sw.WriteLine(msy);
                sw.WriteLine(seed);
                sw.WriteLine(smooth);
                sw.WriteLine(x);
                sw.WriteLine(y);
            }
        }
        
        public static void ReadFile(ref cMaze maze, ref int msx, ref int msy, ref int seed, ref int smooth, string name, ref int x, ref int y)
        {
            StreamReader sr;
            using (sr = new StreamReader(@"mazesave_"+name+".sav", Encoding.UTF8))
            {
                msx = int.Parse(sr.ReadLine());
                msy = int.Parse(sr.ReadLine());
                seed = int.Parse(sr.ReadLine());
                smooth = int.Parse(sr.ReadLine());
                x = int.Parse(sr.ReadLine());
                y = int.Parse(sr.ReadLine());
            }
        }
    }
}

